//
//  ONSettingParentViewController.m
//  Volatix
//
//  Created by Familly on 6/28/14.
//  Copyright (c) 2014 Familly. All rights reserved.
//

#import "ONSettingParentViewController.h"
#import "ONRatingAppsViewController.h"
#import "ONLicenseViewController.h"
#import "ONPolicyViewController.h"
#import "ONCopyRightViewController.h"
#import "ONSupportViewController.h"
@interface ONSettingParentViewController ()

@end

@implementation ONSettingParentViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    ONTabbarViewController *_tabbar =(ONTabbarViewController*)self.tabBarController;
    _tabbar.tabbarDelegateDayAhead_Detail=self;
    _tabbar.isLeftBackButton = YES;
    [_tabbar.ButtonLeft setHidden:false];
    [_tabbar.buttonSetting setHidden:true];
    [_tabbar.ButtonLeft setImage:[UIImage imageNamed:@"arrow_left.png"] forState:UIControlStateNormal];
    
    
    
    switch (self.Type) {
        case TYPE_SUPPORT:
        {
             _tabbar.title = @"Support";
        }
            break;
        case TYPE_COPY_RIGHT:
        {
             _tabbar.title = @"Copyright";
        }
            break;
        case TYPE_POLICY:
        {
             _tabbar.title = @"Policy";
        }
            break;
        case TYPE_LICENSE:
        {
             _tabbar.title = @"License";
        }
            break;
        case TYPE_RATING_APP:
        {
             _tabbar.title = @"Rating Apps";
        }
            break;

            
        default:
            break;
    }
    
    
    
//    if([self isKindOfClass:[ONRatingAppsViewController class]])
//    {
//        _tabbar.title = @"Rating Apps";
//
//    }
//    else if([self isKindOfClass:[ONLicenseViewController class]])
//    {
//        
//        _tabbar.title = @"License";
//
//    }
//    
//    else if([self isKindOfClass:[ONPolicyViewController class]])
//    {
//         _tabbar.title = @"Policy";
//        
//    }
//    else if([self isKindOfClass:[ONCopyRightViewController class]])
//    {
//         _tabbar.title = @"Copyright";
//    }
//    else if([self isKindOfClass:[ONSupportViewController class]])
//    {
//        _tabbar.title = @"Support";
//    }
    
}
-(void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    
    ONTabbarViewController *_tabbar =(ONTabbarViewController*)self.tabBarController;
    [_tabbar.ButtonLeft setImage:[UIImage imageNamed:@"btn_add.png"] forState:UIControlStateNormal];
    _tabbar.tabbarDelegateDayAhead_Detail=nil;
    _tabbar.isLeftBackButton = NO;
    _tabbar.title = @"Volatix Power Market";
}
-(void)backToScreen:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
